package com.scpcfe.www.controller;

import com.scpcfe.www.entity.StudentInfoEntity;
import com.scpcfe.www.service.StudentInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;
@RestController
@Slf4j
public class classOne {

    @GetMapping("/enter1")
    public String enter(String stuId) {
        List<StudentInfoEntity> entityList = StudentInfoService.studentInfoService.getStudentInfo(stuId);
        StringBuilder result = new StringBuilder();
        for (StudentInfoEntity entity : entityList) {
            System.out.println(entity.getStuName());
            System.out.println(entity.getAge());
            result.append(entity.getStuName()).append(entity.getAge()).append("\n");
        }
        return result.toString();
    }
}


